package Table;


import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import java.awt.BorderLayout;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

import danhmuc.DonViTinh;
import form.DSJ_DonVi;
import form.DSJ_NhomHang;

import trangchu.UtilDelegate;
import trangchu.TrangChu;
import java.awt.Dimension;
import java.beans.Statement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Vector;


public class TDonViTinh extends JPanel {


	public TDonViTinh(DonViTinh DonViTinh) {
		DSJ_DonVi b = new DSJ_DonVi();
		Vector list = b.getUsers();
		Vector<String> columns = new Vector<String>();
		columns.add("Mã Đơn Vị");
		columns.add("Tên Đơn Vị");
			
		JScrollPane scrollPane = new JScrollPane();
		JTable table = new JTable(list,columns);
		
		TableColumn col = table.getColumnModel().getColumn(0);		col.setPreferredWidth(500);
		TableColumn col1 = table.getColumnModel().getColumn(1);		col1.setPreferredWidth(500);
		
		table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
		setLayout(new BorderLayout(0, 0));
		scrollPane.setViewportView(table);
		add(scrollPane);
		
		
		
	

	
	}
}
